<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2021/11/13 0013
 * Time: 下午 3:49
 */

namespace app\controller;


use think\exception\HttpException;
use think\facade\Log;
use think\Image;

class Picture
{

    public function index(){
        
        $image = Image::open("ab.jpg");

        //return $image->type().$image->width();
       // $image->crop(200,300)->save("ab1.jpg");
        //$image->thumb(600,600)->save("ab2.jpg");

       //throw new HttpException(404,"页面没有吧");

        abort(404,"异常了吧");
    }

    public function log(){

        //Log::record("我要写点日志");
        //Log::write("时时写入点","error");
        //Log::close();

//        try{
//
//            echo 100/0;
//        }catch (ErrorException $exception){
//
//            //echo $exception->getMessage();
//            //echo "没有捕获到";
//            //Log::write($exception->getMessage(),"warning");
//        }
        Log::record("嗯，上古神器6","info");
        //Log::clear();//执行此语句，内存无数据了，也不记录了
        //dd(Log::getLog());
        Log::diy("自己搞的日志");

    }
}